#include "baseinfo.h"

BaseInfo::BaseInfo() {}

QString BaseInfo::GetImageSrcPath(){
    return m_strImageSrcPath;
}

void BaseInfo::SetImageSrcPath(QString imageSrcPath){
    m_strImageSrcPath = imageSrcPath;
}

bool BaseInfo::WriteXML(QXmlStreamWriter &writer){
    // 写入当前操作的信息
    writer.writeStartElement("BaseInfo");
    writer.writeTextElement("ImageSrcPath",m_strImageSrcPath);
    writer.writeEndElement();
    return true;
}

bool BaseInfo::ReadXML(QXmlStreamReader &reader){
    QXmlStreamReader::TokenType token = reader.readNext();
    while (!(reader.tokenType() == QXmlStreamReader::EndElement &&
             reader.name() == QStringLiteral("BaseInfo"))) {

        if (reader.name() == QStringLiteral("ImageSrcPath")) {
            m_strImageSrcPath = reader.readElementText().toStdString().c_str();
        }

        reader.readNext();
    }

    reader.readNext();
    reader.readNext();
    return true;
}
